-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Add stubs for ephem #15191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add stubs for ephem #15191
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
srittau
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, just a few smaller remarks below.
| ephem.tests.* | ||
| ephem.stars.k | ||
| ephem.stars.v | ||
| ephem._libastro.Observer.__init__ | ||
| ephem.FixedBody.__init__ | ||
| ephem._libastro.FixedBody.__init__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add comments to group and explain these entries? Probably something like this:
# Tests
ephem.tests.*
# Leaked loop variables
ephem.stars.k
ephem.stars.v
# ?
ephem._libastro.Observer.__init__
ephem.FixedBody.__init__
ephem._libastro.FixedBody.__init__
|
|
||
| from . import _libastro | ||
|
|
||
| __version__: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constants should be marked as Final:
| __version__: str | |
| __version__: Final[str] |
(Also applies to all the constants below.)
| STAR_NUMBER_NAME: dict[int, str] | ||
| STAR_NAME_NUMBER: dict[str, int] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be Final, too.
This PR adds initial type stubs for the ephem library (PyPI:
pyephem).ephemis a widely used library for high-precision astronomy calculations. Since it is largely implemented in C, static analysis tools currently have difficulty providing completions and type safety for it.The stubs provide comprehensive coverage for the publicly accessible API, including:
__init__)_libastroC-extension interfacecitiesandstarsdatabases